//
//  WeeksGoalSwitchView.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/11/11.
//

import Foundation
import MYModule

class GoalSetupWeeksSwitchView: View {
    
    override func makeUI() {
        super.makeUI()
        
        self.addSubview(self.switchView)
        self.switchView.snp.makeConstraints { make in
            make.width.equalTo(44)
            make.height.equalTo(30)
            make.centerY.equalToSuperview()
            make.trailing.equalTo(-20)
        }
        
        self.addSubview(self.title)
        self.title.snp.makeConstraints { make in
            make.leading.equalTo(20)
            make.top.equalTo(22)
            make.trailing.equalTo(self.switchView.snp.leading).offset(-20)
            make.centerY.equalToSuperview()
        }
        
        self.addSubview(self.underscoreView)
        self.underscoreView.snp.makeConstraints { make in
            make.bottom.equalToSuperview()
            make.leading.equalTo(20)
            make.centerX.equalToSuperview()
            make.height.equalTo(0.5)
        }
        
    }
    
    //MARK: - lazy load -
    private lazy var title: Label = {
        let label = Label()
        label.font = Fonts.boldSystemFont(ofSize: 22)
        label.textColor = UIColor.assist_222222
        label.text = "goal_setting_exercise_day_title".language
        return label
    }()
    
    public lazy var switchView: CustomSwitchView = {
        let switchView = CustomSwitchView()
        switchView.onTintColor = UIColor.theme
        switchView.inactiveColor = UIColor.assist_D0D0D0
        return switchView
    }()
    
    private lazy var underscoreView: View = {
        let view = View()
        view.backgroundColor = .assist_D0D0D0
        return view
    }()
}
